﻿using Microsoft.AspNetCore.Authentication;

namespace TK.Common.Authorization
{
    /// <summary>
    /// AuthorizationExtension
    /// </summary>
    public static class AuthorizationExtension
    {
        /// <summary>
        /// 验证服务封装
        /// </summary>
        public static IServiceCollection AddTKAuthentication(this IServiceCollection services, IConfiguration configuration)
        {
            services.AddAuthentication("SimpleAuthentication")
                .AddScheme<AuthenticationSchemeOptions, SimpleAuthHandler>("SimpleAuthentication", null);
            return services;
        }
    }
}
